package org.hxyjs.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author 
 */
public class Press implements Serializable,Account {
    private String prno;

    private String ano;

    private String primg;

    private String prname;

    private String prsite;

    private String prphone;

    private String prnumber;

    private String prid;

    private String prpwd;

    private String prdescribe;

    private Integer prstate;

    private String premail;

    private List<Books> books;

    String salt;//加密用的盐

    Integer isDelete;

    Date createDate;

    List<AccountRole> accountRoles;

    public String getSalt() {
        return salt;
    }

    @Override
    public Boolean getLocked() {
        return null;
    }

    @Override
    public String getCredentialsSalt() {
        return getAccountname()+salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    @Override
    public String getAccountid() {
        return prno;
    }

    @Override
    public String getAccountname() {
        return prname;
    }

    @Override
    public String getPassword() {
        return prpwd;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public List<AccountRole> getAccountRoles() {
        return accountRoles;
    }

    public void setAccountRoles(List<AccountRole> accountRoles) {
        this.accountRoles = accountRoles;
    }

    private static final long serialVersionUID = 1L;


    public String getPrno() {
        return prno;
    }

    public void setPrno(String prno) {
        this.prno = prno;
    }

    public String getAno() {
        return ano;
    }

    public void setAno(String ano) {
        this.ano = ano;
    }

    public String getPrimg() {
        return primg;
    }

    public void setPrimg(String primg) {
        this.primg = primg;
    }

    public String getPrname() {
        return prname;
    }

    public void setPrname(String prname) {
        this.prname = prname;
    }

    public String getPrsite() {
        return prsite;
    }

    public void setPrsite(String prsite) {
        this.prsite = prsite;
    }

    public String getPrphone() {
        return prphone;
    }

    public void setPrphone(String prphone) {
        this.prphone = prphone;
    }

    public String getPrnumber() {
        return prnumber;
    }

    public void setPrnumber(String prnumber) {
        this.prnumber = prnumber;
    }

    public String getPrid() {
        return prid;
    }

    public void setPrid(String prid) {
        this.prid = prid;
    }

    public String getPrpwd() {
        return prpwd;
    }

    public void setPrpwd(String prpwd) {
        this.prpwd = prpwd;
    }

    public String getPrdescribe() {
        return prdescribe;
    }

    public void setPrdescribe(String prdescribe) {
        this.prdescribe = prdescribe;
    }

    public Integer getPrstate() {
        return prstate;
    }

    public void setPrstate(Integer prstate) {
        this.prstate = prstate;
    }

    public String getPremail() {
        return premail;
    }

    public void setPremail(String premail) {
        this.premail = premail;
    }

    public List<Books> getBooks() {
        return books;
    }

    public void setBooks(List<Books> books) {
        this.books = books;
    }


    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Press other = (Press) that;
        return (this.getPrno() == null ? other.getPrno() == null : this.getPrno().equals(other.getPrno()))
            && (this.getAno() == null ? other.getAno() == null : this.getAno().equals(other.getAno()))
            && (this.getPrimg() == null ? other.getPrimg() == null : this.getPrimg().equals(other.getPrimg()))
            && (this.getPrname() == null ? other.getPrname() == null : this.getPrname().equals(other.getPrname()))
            && (this.getPrsite() == null ? other.getPrsite() == null : this.getPrsite().equals(other.getPrsite()))
            && (this.getPrphone() == null ? other.getPrphone() == null : this.getPrphone().equals(other.getPrphone()))
            && (this.getPrnumber() == null ? other.getPrnumber() == null : this.getPrnumber().equals(other.getPrnumber()))
            && (this.getPrid() == null ? other.getPrid() == null : this.getPrid().equals(other.getPrid()))
            && (this.getPrpwd() == null ? other.getPrpwd() == null : this.getPrpwd().equals(other.getPrpwd()))
            && (this.getPrdescribe() == null ? other.getPrdescribe() == null : this.getPrdescribe().equals(other.getPrdescribe()))
            && (this.getPrstate() == null ? other.getPrstate() == null : this.getPrstate().equals(other.getPrstate()))
            && (this.getPremail() == null ? other.getPremail() == null : this.getPremail().equals(other.getPremail()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPrno() == null) ? 0 : getPrno().hashCode());
        result = prime * result + ((getAno() == null) ? 0 : getAno().hashCode());
        result = prime * result + ((getPrimg() == null) ? 0 : getPrimg().hashCode());
        result = prime * result + ((getPrname() == null) ? 0 : getPrname().hashCode());
        result = prime * result + ((getPrsite() == null) ? 0 : getPrsite().hashCode());
        result = prime * result + ((getPrphone() == null) ? 0 : getPrphone().hashCode());
        result = prime * result + ((getPrnumber() == null) ? 0 : getPrnumber().hashCode());
        result = prime * result + ((getPrid() == null) ? 0 : getPrid().hashCode());
        result = prime * result + ((getPrpwd() == null) ? 0 : getPrpwd().hashCode());
        result = prime * result + ((getPrdescribe() == null) ? 0 : getPrdescribe().hashCode());
        result = prime * result + ((getPrstate() == null) ? 0 : getPrstate().hashCode());
        result = prime * result + ((getPremail() == null) ? 0 : getPremail().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", prno=").append(prno);
        sb.append(", ano=").append(ano);
        sb.append(", primg=").append(primg);
        sb.append(", prname=").append(prname);
        sb.append(", prsite=").append(prsite);
        sb.append(", prphone=").append(prphone);
        sb.append(", prnumber=").append(prnumber);
        sb.append(", prid=").append(prid);
        sb.append(", prpwd=").append(prpwd);
        sb.append(", prdescribe=").append(prdescribe);
        sb.append(", prstate=").append(prstate);
        sb.append(", premail=").append(premail);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}